{% extends "base_operlist.html" %}
{%block title%}
Operasyon Listesi
{%endblock%}

{%block content%}
<fieldset class="module aligned ">
<div style="margin: 0 50%;">
<h4><a href="/operlist/patient/add/">Hasta&nbsp;Ekle</a>&nbsp;|&nbsp;<a href="javascript:void(0);" onclick="PopupCenter('operlist/ajax/', 'myPop1',screen.width,screen.height)";>Ön&nbsp;izleme</a></h4>
</div>

{%if addform %}

	{% if addform.errors %}
        <p style="color: red;">
           Bilgilerinizde hata var.. Lütfen Düzeltin ({{ addform.errors }}).
        </p>
	{% endif %}
<div class="form-row category  ">

  <form method="POST" action="/operlist/patient/saveas/">
  <label for="id_name">Adı&nbsp;Soyadı&nbsp;:</label>{{addform.name}}<br>
  <label for="id_aciklama">Açıklama&nbsp;:</label>{{addform.aciklama}}<br>
  <label for="id_durum">Durum&nbsp;:</label>{{addform.durum}}
  <input type="submit"  onclick="this.disabled=true;this.value='Ekliyor..';this.form.submit();" value="Ekle">
  
  </form>


</div>
{%endif%}

<br>
{%if hlist%}

	<div id="bluetable">
	<table>
	<tbody>
		{% for h in hlist %}
			
			<tr{% if forloop.counter|divisibleby:"2"%} class="odd"{%endif%}>
			<th scope="row">{{forloop.counter}}</th>
			<td>{{h.name}}</td>
			<td>{{h.aciklama}}</td>
			<td>{{h.durum}}</td>
			<td style="vertical-align: middle;"><a href="/operlist/delete/?id={{h.id}}"><img border="0" src="/media/images/icon_deletelink.gif"/></a></td>
			</tr>
	
		{%endfor%}
	</tbody>

	</table>
	
	</div>

{%endif%}
</fieldset>
{%endblock%}
{%block script%}
<link rel="stylesheet" type="text/css" href="/media/css/forms.css" />
<link rel="stylesheet" type="text/css" href="/media/css/table-blue.css" />
<script>
function PopupCenter(pageURL, title,w,h) {
	var mydomain=window.location.href.match(/:\/\/(.[^/]+)/)[1];
	//alert(mydomain);
	var pageURL="http://"+mydomain+"/"+pageURL;
	//alert("2 : "+pageURL);
	
	var left = (screen.width/2)-(w/2);
	var top = (screen.height/2)-(h/2);
	var targetWin = window.open (pageURL, title, 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, copyhistory=no, width='+w+', height='+h+', top='+top+', left='+left);

}
</script>
{%endblock%}